<?php
defined('_JEXEC') or die('Restricted access');
$id = JRequest::getVar('id');
$db = JFactory::getDBO();
$query = 'SELECT up.date, up.id as order_id, u.* FROM #__users_pay up INNER JOIN #__users as u ON up.user_id = u.id WHERE up.id = '.$id;
$db->setQuery($query);
$user_info = $db->loadObject();
$tmp = explode(' ', $user_info->date);
$tmp1 = explode('-', $tmp[0]);
$date = $tmp1[2].'-'.$tmp1[1].'-'.$tmp1[0];
?>
<table style="width:780px; margin:0px auto; padding:10px;" width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  	<td colspan="1">
    	<table width="780px" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td style="background-color:#999999; padding:1px; color:white; font-size:15px; font-weight:bold;" colspan="2" >Ordreinformation</td>
          </tr>
          <tr>
            <td style="color:#323232; font-size:12px; padding:1px;" width="313">Ordre nummer:</td>
            <td width="467" style="color:#323232; font-size:12px; padding:1px;"><?php echo $user_info->order_id;?></td>
          </tr>
		  <tr>
            <td style="color:#323232; font-size:12px; padding:1px;" width="313">Faktura dato:</td>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; "><?php echo $date;?></td>
          </tr>
          <tr>
            <td style="background-color:#999999; padding:1px; color:white; font-size:15px; font-weight:bold;" colspan="2" >Kundeinformation</td>
          </tr>
          
          <tr>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; ">Kundenavn:</td>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; "><?php echo $user_info->name;?></td>
          </tr>
          <tr>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; ">Adresse:</td>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; "><?php echo $user_info->address;?></td>
          </tr>
          <tr>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; ">Postnummer:</td>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; "><?php echo $user_info->code;?></td>
          </tr>
          <tr>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; ">By:</td>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; "><?php echo $user_info->city;?></td>
          </tr>
          <tr>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; ">Telefon/mobil:</td>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; "><?php echo $user_info->phone;?></td>
          </tr>
		  <tr>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; ">Firma-navn:</td>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; "><?php echo $user_info->company;?></td>
          </tr>
          <tr>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; ">CVR-nr.:</td>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; "><?php echo $user_info->cvr;?></td>
          </tr>
          <tr>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; ">E-mail:</td>
            <td style="color:#323232; font-size:12px; padding:1px; width:30%; "><?php echo $user_info->email;?></td>
          </tr>
       </table>
    </td>
  </tr>
  <tr>
  	<td style="border-bottom: 1px solid #999999;">
  		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
	            <td style="background-color:#999999; padding:1px; color:white; font-size:15px; font-weight:bold;" colspan="8" >Ordrelinier</td>
	        </tr>
			<tr>
		       	<td width="85" style="color:#323232; font-size:11px; text-align:center; padding:1px; ">Antal</td>
		       	<td width="241" style="color:#323232; font-size:11px; text-align:center; padding:1px; ">Navn</td>
		       	<td width="125" style="color:#323232; font-size:11px; text-align:center; padding:1px; ">Pris/enhed</td>
                <td width="212" style="color:#323232; font-size:11px; text-align:center; padding:1px; ">Subtotal</td>
                		    
		    </tr>
			
			<tr>
		       	<td style="color:#323232; font-size:11px; text-align:center; padding:1px; ">1</td>
		       	<td style="color:#323232; font-size:11px; text-align:center; padding:1px; ">Login online auktion</td>
		       	<td style="color:#323232; font-size:11px; text-align:center; padding:1px; ">DKK 3.000,-</td>

				<td style="color:#323232; font-size:11px; text-align:center; padding:1px; ">DKK 3.000,-</td>
		    </tr>    
        </table>
  	</td>
  </tr>
  <tr>
  	<td style="text-align: right; color:#323232; font-size:14px; padding:0px; padding:2px 43px 50px 0; font-weight: bold;">Total at betale: DKK 3.000,-</td>
  </tr>
  <tr>
  	<td style="background-color:#999999; padding:1px; ">
  		<p style="color:#FFF; font-size:13px; margin:0;"> Dansk Automobil Børs · Sandbækvej 3 · 2610 Rødovre · Tlf. +45 33 21 37 33 · Fax. +45 33 21 37 44 · Email: info@dabauk.dk</p> 
	</td>
  </tr>
</table>